/*
 * title: 路由
 * date: 2019-05-15
 * author: wjh
 */

import Vue from 'vue'
import Router from 'vue-router'

import root from './modules/root' // 基本的
import me from './modules/me' // 我的
import page from './modules/page' // 设置

Vue.use(Router)

export default new Router({
  // mode: 'history',
  base: process.env.BASE_URL,
  scrollBehavior (to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return { x: 0, y: 0 }
    }
  },
  routes: [
    ...root,
    me,
    page
  ]
})
